﻿// Copyright (c)  MOKEYISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

namespace NSQL.Expressions.Functions
{
    public class NvlFunction : BaseExpression, INvlFunction
    {
        public IValueExpression Expr { get; set; }
        public IValueExpression Then { get; set; }
        public IValueExpression Default { get; set; }

        public NvlFunction(IValueExpression expression, IValueExpression @default)
        {
            Expr = expression;
            Default = @default;
        }

        public NvlFunction(IValueExpression expression, IValueExpression then, IValueExpression @default)
        {
            Expr = expression;
            Default = @default;
            Then = then;
        }
        public override T Accept<T>(IExpressionVisitor<T> visitor) => visitor.Visit(this);
    }
}